Skip to content

Conversation

mchesler613
Copy link

Fixed several grammatical typos and reword the section on combining PollList and PollDetail to a viewset for clarity.

Fixed several grammatical typos and reword the section on combining `PollList` and `PollDetail` to a viewset for clarity.
Comment on lines -16 to +17
- :code:`/polls/<pk>/choices/` to GET the choices for a specific poll, and to create choices for a specific poll. (Idenitfied by the :code:`<pk>`)
- :code:`/polls/<pk>/choices/<choice_pk>/vote/` - To vote for the choice identified by :code:`<choice_pk>` under poll with :code:`<pk>`.
- :code:`/polls/<pk>/choices/` - to GET the choices for a specific poll, and to create choices for a specific poll. (Identified by the :code:`<pk>`)
- :code:`/polls/<pk>/choices/<choice_pk>/vote/` - to vote for the choice identified by :code:`<choice_pk>` under poll with :code:`<pk>`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding just the - doesn't make sense. Indent the code for better readability.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like this:

- :code:`/polls/<pk>/choices/`                      -   to GET the choices for a specific poll, and to create choices for a specific poll. (Identified by the :code:`<pk>`)
- :code:`/polls/<pk>/choices/<choice_pk>/vote/`     -   to vote for the choice identified by :code:`<choice_pk>` under poll with :code:`<pk>`.

Comment on lines +158 to +167
```py
class PollList(generics.ListCreateAPIView):
queryset = Poll.objects.all()
serializer_class = PollSerializer


class PollDetail(generics.RetrieveDestroyAPIView):
queryset = Poll.objects.all()
serializer_class = PollSerializer
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a generic view, not viewset. Please revert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants